package org.example.interfaces;

public class Person {
    public void getPic(IPic pic) {
        pic.pic();
    }

    public static void main(String[] args) {

        Person person = new Person();
        person.getPic(new Phone());
        person.getPic(new Door());
        person.getPic(new Ipad());
    }
//        IPic pic1 = new Phone();
//        IPic pic2 = new Ipad();
//        pic1.pic();
//        pic2.pic();//多态
//        IPic pic = new IPic() {
//            @Override
//            public void pic() {
//
//            }
//        };
//    }
}
